﻿using FX_API.Models;
using FX_API;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FX_API.Factory
{
    public class UploadModelFactory
    {
        public static FXCreateRequestModel GetFXCreateRequestModel(IObjectData object_data, bool triggerWorkFlow = false)
        {
            return new FXCreateRequestModel()
            {
                corpAccessToken = FenxiangAPI.corpAccessToken,
                corpId = FenxiangAPI.corpId,
                currentOpenUserId = FenxiangAPI.openUserId,
                triggerWorkFlow = triggerWorkFlow,
                data = new UploadData() { object_data = object_data }
            };
        }

        public static FXCreateRequestModel GetFXCreateRequestModelWithDetails(IObjectData object_data, object details, bool triggerWorkFlow = false)
        {
            return new FXCreateRequestModel()
            {
                corpAccessToken = FenxiangAPI.corpAccessToken,
                corpId = FenxiangAPI.corpId,
                currentOpenUserId = FenxiangAPI.openUserId,
                triggerWorkFlow = triggerWorkFlow,
                data = new UploadData()
                {
                    object_data = object_data,
                    details = details
                }
            };
        }
    }
}
